/* test recursive data structures with function call as return value*/
struct list {
	int data;
	struct list * next;
};
/*@*/
struct list * search(struct list* head, int data)
{
	struct list * p;
	p=head;
	while(p!= NULL &&(p->data!=data))
	{
		p=p->next;
	}
	return p;
}
/*@*/
/*@*/
int main()
{
	struct list * head;
	struct list * test;
	struct list * p;
	struct list * q;
	int i;
	i=0;
	
	head=alloc(struct list);
	head->next=NULL;
	head->data=-1;
	p=head;
	q=head;
	while (i<100000)
	{
		p= alloc(struct list);
		p->data=i;
		print(p->data);
		p->next=NULL;
		q->next=p;
		q=p;
		i=i+1;
	}
	p=head;
	p=search(head,5);
	print(p->data);
	return 0;
}
/*@*/
	

